using UnityEngine;
using System.Collections;

public abstract class AbstractCharacter : MonoBehaviour{
	
	public delegate void CharacterEvent(AbstractCharacter character);
	
	public event CharacterEvent EventDead;
	
	public float gravity = -4f;
	public float speed = 1f;
	
	public bool IsDead { get; protected set; }
		
	public void Kill(){
		if(IsDead) return;
		
		IsDead = true;
		if(EventDead!=null) EventDead(this);
		
		gameObject.SetActiveRecursively(false);
	}
	
}

